<?php


namespace app\index\model;


class ChatUser extends Base
{
    protected $pk = 'id';
    public function getUser()
    {
        return $this->belongsTo('app\user\model\User','get_u_id','u_id');
    }
    public function sendUser()
    {
        return $this->belongsTo('app\user\model\User','send_u_id','u_id');
    }
    public function reg($map)
    {
        $user =$this->get($map);
        if( $user==null){
            $this->saveModel($map);
        }else{
            return 1;
        }
    }

}